﻿
@using Projectmanagement.Entity
@(Html.Telerik().Grid<SimulatorConfig>().Name("Grid")
.DataKeys(keys => { keys.Add(sc => sc.ID); })
.DataBinding(dataBinding =>
{
    dataBinding.Ajax()
        .Select("_SelectIndex", "SimulatorConfig")
        .Update("_SaveAjaxEditing", "SimulatorConfig");
})
.Columns(columns =>
{
    columns.Bound(sc => sc.SimulatorName);
    columns.Command(commands =>
    {
        commands.Edit();
    }).Width(100).Title("操作");
})
              .ClientEvents(events => events.OnDataBound("onDataBound").OnSave("onSave"))
   .Editable(editing => editing.Mode(GridEditMode.PopUp))
   .Pageable(p => p.Style(GridPagerStyles.Status)
       .PageOnScroll(true)).Scrollable().Sortable().Filterable()
    .Scrollable(c => c.Height("570px"))
    .Resizable(resizing => resizing.Columns(true))
    )
<script type="text/javascript">
    var isflash = false;
    function onDataBound(e) {
        if (isflash) {
            location.reload();
        }
    }

    function onSave(e) {
        isflash = true;
    } 


</script>
